import { ipcMain } from "electron";
import { saveUserInfo, getUserInfo } from '../services/userSave'

export const startUserIpc = (win) => {
  ipcMain.handle('saveUserInfo', (event, userInfo) => {
    return saveUserInfo(userInfo)
  });

  ipcMain.handle('getUserInfo', (event) => {
    return getUserInfo()
  });

  ipcMain.on('userInfo', (event, userInfo) => {
    win.webContents.send('userInfo', userInfo)
  })
}
